
import AbsControler from '../abscontroler.js'
import LMosDownPlotTool from './plot/act2lmosdown.js'
import LMosUpPlotTool from './plot/act2lmosup.js'
import RMosUpPlotTool from './plot/act2rmosup.js'
import MosMovePlotTool from './plot/act2mosmove.js'
import DBLClickPlotTool from './plot/act2dblclick.js'
import {LGXEnums}  from '../../common/sysenum.js'


class PlotControler extends AbsControler.AbsControler  {
    constructor(datamanger) {
        super(datamanger);
    }

    act2Mouse(mosEvnt,worldPos) {
        if (mosEvnt.type == LGXEnums.LGXMouseMode.LMouseDown) {
            LMosDownPlotTool.LeftMoseDownPlotTool.action(this.dataManger,mosEvnt,worldPos);
        }
        else if (mosEvnt.type == LGXEnums.LGXMouseMode.LMouseUp) {
            LMosUpPlotTool.LeftMoseUpPlotTool.action(this.dataManger,mosEvnt,worldPos);
        }
        else if (mosEvnt.type == LGXEnums.LGXMouseMode.RMouseDown
            ||mosEvnt.type == LGXEnums.LGXMouseMode.RMouseUp) {
            // RMosUpPlotTool.RightMoseUpPlotTool.action(this.dataManger,mosEvnt,worldPos);
            DBLClickPlotTool.DBLClickPlotTool.action(this.dataManger,mosEvnt,worldPos);
        }
        else if (mosEvnt.type == LGXEnums.LGXMouseMode.LMouseDbClick){
            DBLClickPlotTool.DBLClickPlotTool.action(this.dataManger,mosEvnt,worldPos);
        }
        else if (mosEvnt.type == LGXEnums.LGXMouseMode.mouseMove
             || mosEvnt.type == LGXEnums.LGXMouseMode.mouseDrag){
            MosMovePlotTool.MosMovePlotTool.action(this.dataManger,mosEvnt,worldPos);
        }
    }
}

export default { PlotControler }

